package com.dabai.iot.core.config;

import com.dabai.common.tdengine.core.TDEngineTemplate;
import com.dabai.iot.core.service.IDeviceService;
import com.dabai.iot.core.task.BatchLogProcessor;
import com.dabai.iot.core.task.DeviceStatusProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 批量处理配置
 *
 * @author kev1n
 */
@Configuration(proxyBeanMethods = false)
public class IotTaskConfiguration {

    // 设备状态处理器
    @Bean
    public DeviceStatusProcessor deviceStatusProcessor(IDeviceService deviceService) {
        return new DeviceStatusProcessor(deviceService);
    }

    // 时序数据库批量写入处理器
    @Bean
    public BatchLogProcessor batchLogProcessor(TDEngineTemplate tdEngineTemplate) {
        return new BatchLogProcessor(tdEngineTemplate);
    }

}
